package com.owc.common.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author xiaom
 * @Date 2019/12/17 14:18
 * @Version 1.0.0
 * @Description <>
 **/
@Getter
public enum TransferTypeEnum {
    IN("IN","划入"),
    OUT("OUT","划出");

    private String type;

    private String desc;

    TransferTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static Optional<TransferTypeEnum> match(String type){
        return Arrays.stream(TransferTypeEnum.values())
                .filter(t -> t.getType().equals(type))
                .findFirst();
    }
}
